<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head th:include="blog/index/include_blog::header"></head>
<body>
	<iframe id="bground" class="visible-lg-block" width="100%" height="100%" style="z-index: -1;width: 100%;position:fixed "></iframe>
	<nav th:include="blog/index/include_blog::nav" class="navbar navbar-default navbar-fixed-top"></nav><!-- 上移悬停下移消失navbar-custom -->
	<div class=container-fluid>
		<div class="row clearfix">
			<!-- 页头开始 -->
			<div class="col-md-12">
				<header class="honey-header" style="background-color: rgba(124,184,199,0.7);border-radius:20px 20px" >
					<div class="container">
						<div class="row">
							<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
								<div class="head-top">
									<p class="fontsize50 zcuti">Honey Blog</p>
									<b class="hidden-xs fontsize30">欢迎来到好呢博客</b>
									<div class="col-md-12 column ">
										<marquee  direction="left" behavior="scroll" scrollamount="5" scrolldelay="0" 
										height="25" loop="-1" width="70%" hspace="10" vspace="10" 
										onMouseOver="this.stop()" onMouseOut="this.start()">
									       <span th:each="notice : ${notices}">
									             <a class="text-success hand" style="font-size:20px;color:#11EEEE" th:href="${notice.url}" th:utext="${notice.title}">asdasdasd</a>
									             &emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;
									             &emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;
									             &emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;
									       </span>
										</marquee>
									</div>
								    <div class="col-md-12 column " style="display: block;">
								        <div class="col-md-12 columns nopadding">
								        	<div class="col-md-12">
								        		<div class="input-group">
								                    <input type="text" placeholder="请输入想要查看的内容！！！" style="border-radius:50px 50px;width:98%;height:50px;" id="searchinput" class="form-control" onkeyup="if(event.keyCode==13) {document.getElementById('search').click();}">
								                    <span class="input-group-btn">
								                        <button class="btn btn-default" id="search" type="button"style="border-radius:50px 50px;width:133%;height:50px;"><i class="glyphicon glyphicon-search"></i></button><input class="form-control hidden" id="selectflag" value="0">
								                    </span>
								                </div>
								        	</div>
					                    </div>
					                </div>
								</div>
							</div>
						</div>
					</div>
				</header> 
			</div>
			<!-- 页头结束 -->
			<!-- 热门开始 -->
			<div class="col-md-12">
		    	<ul class="nav nav-pills">
					<li th:each="hot : ${hots}">
						&emsp;<b class="pull-right" style="font-size:10px;color:red">hot</b> <b class="adt fontsize15 textdanlan hand" th:value="${hot.contentId}" onclick="opencontent(this)" th:text="${hot.title}">热门帖子</b>
					</li>
				</ul>
			    <hr>
		    </div>
		    <!-- 热门结束 -->
			<!-- 中开始 -->
			<div class="col-md-12 column">
				<!-- 一层div 热门层-->
				<div class="col-md-1"></div>
			    <div class="col-md-10 textdanlan">
					<div id="mainContent" >
					    <span>
					        <span class="fontsize30 tcuti" id="fl">帖子</span><i class="fa fa-refresh fa-2x pull-right" title="刷新"><button id="refresh" class="btn-link fontsize30 tcuti">换一换</button></i>
					    </span>
					    <div class="row" id="mainContentChild"></div>
					</div>
					<div class="clearfix" id="nextpage">
						<p id="allcontent" class="blog-allcontent"><span>没有更多内容了ε(┬┬﹏┬┬)3</span></p>
						<a id="morecontent" style="display: none;" class="btn btn-secondary float-right" href="javascript:void(0)" onclick="nextPage()"><span class="fontsize25 textdanlan">更多内容<i class="fa fa-arrow-right"></i></span></a>
					</div>
				 </div> 
				 <div class="col-md-1"></div>
			</div>
			<!-- 中结束 -->
		</div>
	</div>
	<div th:include="blog/index/include_blog::footer"></div>
	</body>
	<script type="text/javascript">
		var pagenum = 1;
		var pagesize = 9;
		var url = '/blog/open/list?pageSize='+ pagesize +'&pageNum=';
		var pagenum1 = 1;
		var pagesize1 = 9;
		var url1 = '/blog/open/listbyrand?pageSize='+ pagesize1 +'&pageNum=';
		var pagenum2 = 1;
		var pagesize2 = 6;
		var objColumn;//暂时存放搜索内容标题
		
		$(function(){
			loadingBlog(url,pagenum,0);
		})
		
		//下一页
		function nextPage(){
			var flag= $("#selectflag").val();
			if(flag==0){
				loadingBlog(url,pagenum,0)
			}else if(flag==1){
				loadingBlog(url1,pagenum1,1)
			}else if(flag==2){
				var url2 = '/blog/open/list?objColumn='+ objColumn +'&pageSize='+ pagesize2 +'&pageNum=';
				loadingBlog(url2,pagenum2,2)
			}
			
		}
		
		//刷新
		$("#refresh").click(function(){
			pagenum1=0;//刷新时重置页码
			$("#selectflag").val("1");//下一页loadingBlog(url1,pagenum1,1)
			$("#mainContentChild").empty();
			document.getElementById("allcontent").style.display = "none";
			document.getElementById("morecontent").style.display = "none";
			loadingBlog(url1,pagenum1,1);
		})
		
		//搜索
		$("#search").click(function(){
			objColumn=$("#searchinput").val();//赋值搜索内容
			if(objColumn==''){
				return layer.msg("请输入内容");
			}
			pagenum2=0;//搜索时重置页码
			$("#selectflag").val("2");//下一页loadingBlog(url2,pagenum2,2)
			var url2 = '/blog/open/list?objColumn='+ objColumn +'&pageSize='+ pagesize2 +'&pageNum=';
			$("#mainContentChild").empty();
			document.getElementById("allcontent").style.display = "none";
			document.getElementById("morecontent").style.display = "none";
			loadingBlog(url2,pagenum2,2);
			$("#searchinput").val("");
		})
	</script>

</html>
